import Home from '../components/Home'
import Menu from '../components/Menu'
import Admin from '../components/Admin'
import About from '../components/about/About'
import Login from '../components/Login'
import Register from '../components/Register'
//2级路由引入
import  Contact   from  '../components/about/Contact.vue'
import  Delivery  from  '../components/about/Delivery.vue'
import  History   from  '../components/about/History.vue'
import  OrderingGuide  from  '../components/about/OrderingGuide.vue'
//引入3级路由
import  Phone  from  '../components/about/contact/Phone.vue'
import  PersonName from  '../components/about/contact/PersonName.vue'

//创建路由跳转
export const   routes = [
  {path:'/',         name:'homeLink',components:{
       default:Home,
       'orderingGuide':OrderingGuide,
       'delivery':Delivery,
       'history':History
  }},
  {path:'/menu',     name:'menuLink',component:Menu},
  {path:'/admin',    name:'adminLink',component:Admin},
  {path:'/about',    name:'aboutLink',redirect:'/about/contact',component:About,children:[
       {path:'/about/contact',name:'contactLink',redirect:'/personname',component:Contact,children:[
         {path:'/phone',name:"phoneNumber",component:Phone},
         {path:'/personname',name:"personName",component:PersonName}
       ]},
       {path:'/delivery',name:'deliveryLink',component:Delivery},
       {path:'/history',name:'historyLink',component:History},
       {path:'/orderingGuide',name:'orderingGuideLink',component:OrderingGuide},

  ]},
  {path:'/login',    name:'loginLink',component:Login},
  {path:'/register', name:'registerLink',component:Register},
  {path:'*',redirect:'/'}
]
